package com.start.manager.controller;


import com.start.manager.domain.common.MenuAll;
import com.start.manager.domain.enums.ResultEnum;
import com.start.manager.service.IMenuService;
import com.start.manager.util.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lijian
 * @since 2019-12-26
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private IMenuService menuService;

    @GetMapping("/getList")
    public ResponseResult getList(){
        List<MenuAll> byRedisList = menuService.findByRedisList();
        return ResponseResult.success(ResultEnum.SUCCESS,byRedisList);
    }


    @GetMapping("/rights/{type}")
    public ResponseResult getRightData(@PathVariable String type){
        switch (type){
            case "list":
                break;
            case "tree":
                break;
            default:
                break;
        }
        return null;
    }


}
